/* init.S -- AT91SAM7 rom init code
**
** Copyright 2006, Brian Swetland.  All rights reserved.     
** See provided LICENSE file or http://frotz.net/LICENSE for details.
*/

#include "../library/arm7.h"
		
.globl _start
#define TOP_OF_STACK 0x00204000

_start:
/* BUG:	use ldm/stm for much faster copies */
init_bss:
	mov r0, #0
	ldr r1, =BSS_START
	ldr r2, =BSS_END
init_bss_loop:
	cmp r1, r2
	beq start
	str r0, [r1], #4
	b init_bss_loop

start:
	ldr sp, =TOP_OF_STACK
		
	ldr r0, =boot
	bx r0
	b .

